From 5e558e659094a2854b33498bb754211506114cee Mon Sep 17 00:00:00 2001 From: Subramanya Sastry Date: Thu, 31 Oct 2013 11:49:04 -0500 Subject: [PATCH] Sync up with Parsoid parserTests. This now aligns with Parsoid commit 325c6e5a47a6b3bf7a26778e534c8acabaca0058 Change-Id: I5c7cf9186197c49de449784265ffd8b0bb2bbb2c --- tests/parser/parserTests.txt | 256 +++++++++++++++++++++++++++++------ 1 file changed, 211 insertions(+), 45 deletions(-) diff --git a/tests/parser/parserTests.txt b/tests/parser/parserTests.txt index 02a66b51ce..13312bb695 100644 --- a/tests/parser/parserTests.txt +++ b/tests/parser/parserTests.txt @@ -1419,11 +1419,21 @@ Bug 52763: Preformatted in
!! input
Blah +{| +| + indented cell (no pre-wrapping!) +|}
!! result

Blah

+ + +
+

indented cell (no pre-wrapping!) +

+
!! end @@ -1893,7 +1903,7 @@ data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"}, !! end !! test -Templates: Dont escape already nowiki-escaped text in template parameters +Templates: Don't escape already nowiki-escaped text in template parameters !! options parsoid=html2wt,wt2wt !! input @@ -2172,9 +2182,9 @@ parsoid=wt2html,wt2wt [[Category:foo]] {{echo| [[Category:foo]]}} !! result - + - + !! end !! test @@ -2186,9 +2196,9 @@ parsoid=wt2html,wt2wt [[Category:foo]] {{echo|b}} !! result
- a
+ a
 
- b
+ b !! end ### @@ -3640,6 +3650,8 @@ External links: link text with spaces !! test External links: wiki links within external link (Bug 3695) +!! options +php !! input [http://example.com [[wikilink]] embedded in ext link] !! result @@ -3647,6 +3659,16 @@ External links: wiki links within external link (Bug 3695)

!! end +!! test +Parsoid: External links: wiki links within external link (Bug 3695) +!! options +parsoid +!! input +[http://example.com [[wikilink]] embedded in ext link] +!! result +

wikilink embedded in ext link

+!! end + !! test BUG 787: Links with one slash after the url protocol are invalid !! input @@ -3791,6 +3813,8 @@ External link containing double-single-quotes in text embedded in italics (bug 4 !! test External link containing double-single-quotes with no space separating the url from text in italics +!! options +php !! input [http://www.musee-picasso.fr/pages/page_id18528_u1l2.htm''La muerte de Casagemas'' (1901) en el sitio de [[Museo Picasso (París)|Museo Picasso]].] !! result @@ -3798,6 +3822,16 @@ External link containing double-single-quotes with no space separating the url f

!! end +!! test +Parsoid:External link containing double-single-quotes with no space separating the url from text in italics +!! options +parsoid +!! input +[http://www.musee-picasso.fr/pages/page_id18528_u1l2.htm''La muerte de Casagemas'' (1901) en el sitio de [[Museo Picasso (París)|Museo Picasso]].] +!! result +

La muerte de Casagemas (1901) en el sitio de Museo Picasso.

+!! end + !! test External link with comments in link text !! input @@ -4899,6 +4933,19 @@ Namespace takes precedence over interwiki link (bug 51680)

!! end +# The previous test doesn't work correctly in html2*, due to not recognizing the +# link as an internal one. This one checks for the correct behavior. +!! test +Link to namespace preferred over interwiki with correct rel attribute +!! options +parsoid=html2wt,html2html +!! input +[[MemoryAlpha:AlphaTest]] +!! result +

MemoryAlpha:AlphaTest +

+!! end + !! test Piped link to namespace !! input @@ -5332,6 +5379,16 @@ Parsoid-centric test: Whitespace in ext- and wiki-links should be preserved

!! end +!! test +Parsoid: Scoped parsing should handle mixed transclusions and plain text +!! options +parsoid +!! input +[[Foo|{{echo|a}} b {{echo|c}}]] +!! result +

a b c

+!! end + ### ### Interwiki links (see maintenance/interwiki.sql) ### @@ -5378,6 +5435,22 @@ Interwiki link with fragment (bug 2130)

!! end +# Ideally the wikipedia: prefix here should be proto-relative too +!! test +Different interwiki prefixes mapping to the same URL +!! options +parsoid +!! input +[[wikipedia:Foo]] + +[[:en:Foo]] +!! result +

wikipedia:Foo

+ + +

en:Foo

+!! end + ### ### Interlanguage links @@ -5477,7 +5550,7 @@ parsoid [[ko:]] !! result

-

+

!! end !! test @@ -5487,7 +5560,7 @@ parsoid !! input [[:ko:]] !! result -

ko:

+

ko:

!! end ### @@ -5550,7 +5623,7 @@ parsoid=wt2html !! input #REDIRECT [[Category:Foo]] !! result - + !! end !! test @@ -5560,7 +5633,7 @@ parsoid=wt2html !! input #REDIRECT [[Category%3AFoo]] !! result - + !! end !! test @@ -8278,9 +8351,9 @@ parsoid=wt2html,wt2wt [[Category:bar1]][[Category:bar2]]
foo
!!result -
foo
+
foo
-
foo
+
foo
!!end !!test @@ -10134,6 +10207,30 @@ parsoid # #

+!! test +Caption with a template in it +!! options +parsoid +!! input +[[Image:Foobar.jpg|thumb|200px|This caption has a {{echo|transclusion}} in it.]] +!! result +
This caption has a transclusion in it.
+!! end + +!! test +Caption with unbalanced tags in it +!! options +parsoid +!! input +foo +[[Image:Foobar.jpg|thumb|200px|This caption has a
unbalanced tag in it.]] +bar +!! result +

foo

+
This caption has a
unbalanced tag in it.
+

bar

+!! end + ### ### Subpages @@ -10404,7 +10501,7 @@ language=is !! input x[[Category:Foo]]y !! result -

xy

+

xy

!! end !! test @@ -10430,8 +10527,8 @@ parsoid [[Category:Foo]] [[Category:Foo|Bar]] !! result - - + + !! end ### @@ -16386,10 +16483,10 @@ A !!result -

A [1]

+

A [1]

-
    -
  1. ↑ This is a bolded link and this is a transclusion +
      +
    1. ↑ This is a bolded link and this is a transclusion
    !!end @@ -16463,10 +16560,9 @@ A foo {{echo| B C}} !!result -

    A [1] B C}}

    - -
      -
    1. ↑ foo {{echo|
    2. +

      A [1] B C}}

      +
        +
      1. ↑ foo {{echo|
      !!end @@ -16476,13 +16572,11 @@ Ref: 9. unclosed comments should not leak out of ref-body parsoid !!input A foo "},"attrs":{}}' id="cite_ref-1-0" rel="dc:references" typeof="mw:Extension/ref">[1] B C

      - -
        -
      1. ↑ foo
      2. +

        A [1] B C

        +
          +
        1. ↑ foo
        !!end @@ -16495,10 +16589,11 @@ A foo B C !!result -

        A [1] B C

        +

        A [1] B C

        -
          -
        1. ↑ foo
        2. + +
            +
          1. ↑ foo
          !!end @@ -16510,8 +16605,8 @@ parsoid A foo B C bar D !!result -

          A [1] B -C [2] D

          +

          A [1] B +C [2] D

          !!end !!test @@ -16558,10 +16653,10 @@ parsoid !!result -

          [1]

          +

          [1]

          -
            -
          1. ↑ foo <ref>bar</ref> baz
          2. +
              +
            1. ↑ foo <ref>bar</ref> baz
            !!end @@ -16672,10 +16767,13 @@ B bar This should just get lost. !!result -

            A [1] -B [2]

            +

            A [1] +B [2]

            + -
            1. ↑ foo
            2. ↑ bar
            3. +
                +
              1. ↑ foo
              2. +
              3. ↑ bar
              !!end @@ -16703,16 +16801,17 @@ B foo !! result -

              A [1] -B [2]

              +

              A [1] +B [2]

              -
                -
              1. ↑ foo bar for a
              2. -
              3. ↑
              4. -
              -
                -
              1. ↑ foo
              2. +
                  +
                1. ↑ foo bar for a
                2. +
                3. ↑
                + + +
                  +
                1. ↑ foo
                !! end @@ -18356,6 +18455,63 @@ parsoid=html2wt !! end +!! test +Don't strip leading whitespace when handling indent-pre suppressing tags +!! options +parsoid=html2wt +!! input +{| + | indented row +|} +
                + '''This is very bold of you!''' + +{| +| + indented cell (no pre-wrapping!) +|} +
                +foo +
                bar
                +!! result + + +
                indented row
                +

                + This is very bold of you! +

                +
                + indented cell (no pre-wrapping!) +
                +
                +

                foo

                +
                bar
                +!! end + +!! test +Strip leading whitespace when handling indent-pre inducing tags +!! options +parsoid=html2wt +!! input +foo +bar + +foo2 +bar2 + +
                foo
                +bar +!! result +

                foo

                + bar + +foo2 + bar2 + +
                foo
                + bar +!! end + # Wacky -- the leading newline in input is required because # that is what the serializer emits. To be fixed. Not fixing # the test because this test is required to test serialization of @@ -18503,6 +18659,16 @@ parsoid=html2wt

                AB

                !! end +!!test +5. Bug 54262: New entities +!! options +parsoid=html2wt +!! input +foo +!! result +foo +!! end + # ----------------------------------------------------------------- # End of section for Parsoid-only html2wt tests for serialization # of new content -- 2.20.1